﻿#include <iostream>

// 基础情况：当没有参数时结束递归
void print_args() {
    std::cout << std::endl;
}

// 递归打印参数
template<typename T, typename... Args>
void print_args(T first, Args... args) {
    std::cout << first;
    if (sizeof...(args) > 0) {
        std::cout << ", ";
    }
    print_args(args...);
}

// 可变参数函数
template<typename... Args>
void function_multi_param(Args... args) {
    std::cout << "参数数量: " << sizeof...(args) << std::endl;
    std::cout << "参数值: ";
    print_args(args...);
}

enum FilterType {
    BUTTERWORTH,
    CHEBYSHEV,
    ELLIPTIC,
    BESSEL
};

void initFilter(int fs, double freq,  double order, FilterType filter_type) {
    std::cout << "fs: " << fs << std::endl;
    std::cout << "freq: " << freq << std::endl;
    std::cout << "filter_type: " << filter_type << std::endl;
    std::cout << "order: " << order << std::endl;
}

// 测试代码
int main() {
    // 测试不同数量的参数
    function_multi_param(1, 2, 3);                    // 整数
    function_multi_param("Hello", 3.14, true);        // 混合类型
    function_multi_param('A', "World", 42, 3.14);     // 更多参数
    
    return 0;
}
